
<div class="page-title ui-widget-content ui-corner-all">
    <h1>
        <b>SEO Vantinrao.com</b></h1>
    <div class="other">
        <div class="float-left">
            Quản lý toàn bộ thông tin SEO trên website</div>
        <div class="button float-right">
	         <a class="btn ui-state-default" href="<?php echo base_url('cp/content/editMeta/1') ?>"><span class="ui-icon ui-icon-circle-plus"></span>
               Meta Trang chủ</a>
                 <a class="btn ui-state-default" href="<?php echo base_url('cp/content/editMeta/2') ?>"><span class="ui-icon ui-icon-circle-plus"></span>
                Meta Tỉnh thành</a>
            <a class="btn ui-state-default" href="<?php echo base_url('cp/content/editMeta/') ?>"><span class="ui-icon ui-icon-circle-plus"></span>
                Meta Chuyên mục</a>
               
        </div>
        <div class="clearfix">
        </div>
    </div>
</div>
<div class="portlet ui-widget ui-widget-content ui-helper-clearfix ui-corner-all form-container">
	<h1><b></b></h1>
        <div class="other">
          
                
                  
                    <div class="portlet-content">

                    <?php echo form_open('/admin/meta/edit',"class='forms' id='formupdate'");?>
                    <?php echo form_hidden('id', @$meta['id']); ?>
                    <div class="left" style="width:70%">
                       <table cellpadding="0" cellspacing="0" width="100%" border="0">
                        	<?php 
							if($meta['id'] !=1 && $meta['id']!=2){
							?>
                            	<tr>
                                    <td>Chuyên mục</td>
                                     <td>
                                     	<select name="categoryId" id="category">
                                        	<option value="">Please select</option>
                                            <?php 

												foreach($category as $k=>$val){
													echo '<option value="'.$val['id'].'">'.$val['name'].'</option>';
												}
											?>
                                        </select>
                                     </td>
                                </tr>
                                 <tr>
                                    <td>Nhu cầu</td>
                                     <td>
                                     	<select name="needId" id="need">
                                        	<option value="0">Please select</option>
                                        </select>
                                     </td>
                                </tr>
                                   <tr>
                                    <td>Chủng loại</td>
                                     <td>
                                     	<select name="typeId" id="type">
                                        	<option value="0">Please select</option>
                                        </select>
                                     </td>
                                </tr>
                              
                            <?php } ?>
                            <tr>
                                <td>Title</td>
                               <td>
                                    <input class="field text small" name="title" type="text" value="<?php echo @$meta['title'] ?>" style="width:100%;">
                                    <?php echo form_error('title'); ?>
                                </td>
                            </tr>
							<tr>
                                <td>Keyword</td>
                                <td>
									<textarea class="field textarea small" name="keyword" style="width:100%"><?php echo @$meta['keyword'] ?></textarea>
                                    
                                    <?php echo form_error('keyword'); ?>
                                </td>
                            </tr>
							<tr>
                                <td>Description</td>
                               <td>
									<textarea class="field textarea small" name="description" style="width:100%"><?php echo @$meta['description'] ?></textarea>
                                    
                                    <?php echo form_error('description'); ?>
                               </td>
                            </tr>
							<tr>
                            	<td colspan="2"><input type="submit" name="submit" value="Submit" /></td>
                            </tr>
                        </table>
                        </div>
                        <div class="left">
                        	<div style="margin:20px;">
                            	<table cellpadding="0" cellspacing="0" width="100%" border="0">
                                	<tr>
                                    	<td colspan="2" style="line-height:30px;color:#F00"><b>Chú ý:</b></td>
                                        
                                    </tr>
                                    <tr>
                                    	<td width="70" height="22">{provinder}</td>
                                        <td>-> Đánh dấu hiển thị tỉnh</td>
                                    </tr>
                                     <tr>
                                    	<td width="70" height="22">{category}</td>
                                        <td>-> Đánh dấu hiển thị tên chuyên mục</td>
                                    </tr>
                                     <tr>
                                    	<td width="70" height="22">{need}</td>
                                        <td>-> Đánh dấu hiển thị nhu cầu cần</td>
                                    </tr>
                                     <tr>
                                    	<td width="70" height="22">{type}</td>
                                        <td>-> Đánh dấu hiển thị loại</td>
                                    </tr>
                                </table>
                            	
                            </div>
                        </div>
                        <?php echo form_close();?>
                    </div>
                </div>
                <div class="clearfix">
                </div>
                
<script type="text/javascript">
	$(document).ready(function(){
		
		jQuery('#category').change(function(){
					
			var id = jQuery('select#category option:selected').val();
			if(id){
				 $.ajax({
					url: "<?php echo site_url('admin/ajax/combobox'); ?>/"+id+"",
					type: "GET",
					async: false,
					data: '',
					success: function(data) {
						var items =jQuery.parseJSON(data);
						$('#need').html(items['need']);
						$('#type').html(items['type']);
						
					}
				});
			}else {
				var need = '<option value="">Please select...</option>';
				var type = '<option value="">Please select...</option>';
				$('#need').html(need);
				$('#type').html(type);
			}
		});
		
	});
</script>



